package com.fr.base.core.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

public class ListSet
  implements Set, Cloneable, Serializable
{
  private List m_set = null;

  public ListSet()
  {
    this.m_set = new ArrayList();
  }

  public ListSet(int paramInt)
  {
    this.m_set = new ArrayList(paramInt);
  }

  public ListSet(Collection paramCollection)
  {
    this.m_set = new ArrayList();
    if (paramCollection != null)
    {
      Iterator localIterator = paramCollection.iterator();
      while (true)
      {
        Object localObject;
        do
        {
          if (!(localIterator.hasNext()))
            return;
          localObject = localIterator.next();
        }
        while (this.m_set.contains(localObject));
        this.m_set.add(localObject);
      }
    }
  }

  public boolean retainAll(Collection paramCollection)
  {
    return this.m_set.retainAll(paramCollection);
  }

  public boolean contains(Object paramObject)
  {
    return this.m_set.contains(paramObject);
  }

  public Object[] toArray()
  {
    return this.m_set.toArray();
  }

  public Object[] toArray(Object[] paramArrayOfObject)
  {
    return this.m_set.toArray(paramArrayOfObject);
  }

  public Iterator iterator()
  {
    return this.m_set.iterator();
  }

  public boolean removeAll(Collection paramCollection)
  {
    return this.m_set.removeAll(paramCollection);
  }

  public boolean remove(Object paramObject)
  {
    return this.m_set.remove(paramObject);
  }

  public void clear()
  {
    this.m_set.clear();
  }

  public int hashCode()
  {
    return this.m_set.hashCode();
  }

  public boolean addAll(Collection paramCollection)
  {
    int i = 0;
    if (paramCollection != null)
    {
      Iterator localIterator = paramCollection.iterator();
      while (true)
      {
        Object localObject;
        do
        {
          if (!(localIterator.hasNext()))
            break label61;
          localObject = localIterator.next();
        }
        while (this.m_set.contains(localObject));
        this.m_set.add(localObject);
        i = 1;
      }
    }
    label61: return i;
  }

  public int size()
  {
    return this.m_set.size();
  }

  public boolean containsAll(Collection paramCollection)
  {
    return this.m_set.containsAll(paramCollection);
  }

  public boolean add(Object paramObject)
  {
    int i = 0;
    if (!(this.m_set.contains(paramObject)))
    {
      this.m_set.add(paramObject);
      i = 1;
    }
    return i;
  }

  public boolean equals(Object paramObject)
  {
    return this.m_set.equals(paramObject);
  }

  public boolean isEmpty()
  {
    return this.m_set.isEmpty();
  }

  public boolean add(int paramInt, Object paramObject)
  {
    int i = 0;
    if (!(this.m_set.contains(paramObject)))
    {
      this.m_set.add(paramInt, paramObject);
      i = 1;
    }
    return i;
  }

  public Object get(int paramInt)
  {
    return this.m_set.get(paramInt);
  }

  public Object remove(int paramInt)
  {
    return this.m_set.remove(paramInt);
  }

  public int indexOf(Object paramObject)
  {
    return this.m_set.indexOf(paramObject);
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    Object localObject = super.clone();
    if ((this.m_set != null) && (this.m_set instanceof Cloneable))
      ((ListSet)localObject).m_set = ((List)((ArrayList)this.m_set).clone());
    return localObject;
  }

  public void set(int paramInt, String paramString)
  {
    this.m_set.set(paramInt, paramString);
  }
}